|
|
|
|
|
|
|
As you move from page to page on the World Wide Web, you may wonder what sort of intelligence exists on the other end. For example, how does that online music store process orders submitted from its Web pages? How does the shipping company display your package status? The answer is that some type of program is running on the Web server, accepting input from you and dynamically generating Web pages with the results. In the UNIX world, these programs might be CGI scripts or C programs. However, Microsoft has recently entered this area with Active Server Pages, a Web-server component that allows you to use your Visual Basic knowledge to create powerful Web server scripts. This chapter introduces you to Active Server Pages and some of its many features. |
|
|
|
|
|
|
|
|
Introduction to Active Server Pages |
|
|
|
|
|
|
|
|
If you are developing an intranet or Internet application, Active Server Pages is definitely worth investigating. Active Server Pages (ASP) is a component of Microsoft's Web server software that allows you to embed server-side script code in Web pages. As you know, the Hypertext Markup Language (HTML), used to created pages on the World Wide Web, is by itself static content. You can enhance this content on the client side through the use of client-side script, Java applets, Dynamic HTML, or ActiveX controls. However, Active Server Pages is a server-side enhancement, because all the script code (usually VBScript) runs on the server. This means you can create Web sites that are dynamic and database-driven, yet return only standard HTML that is viewable in all browsers. A solution that uses Active Server Pages is ideal when your audience includes both Netscape and IE users or you want to avoid the issues associated with downloading applets or other client-side controls. |
|
|
|
|
|
|
|
|
|
Microsoft's Web server product for the Windows NT operating system is called Internet Information Server (IIS). In addition, Microsoft Personal Web Server is available as a "lightweight" Web server for a desktop PC. The Active Server Pages component is built-in to both Web servers, which at the time of this writing were available for download in the NT/95 Option Pack. For a glimpse at some of the differences between these products, see the upcoming section "Virtual Directories."  |
|
|
|
|
|
|
|
|
|
|
Active Server Pages Versus Standard HTML |
|
|
|
|
|
|
|
|
Internet Information Server identifies an Active Server Page by its .ASP extension. To create a new ASP file, you simply change the extension on an existing .HTM file or start a new text file in a text editor. The ASP file can contain either standard HTML or script code, but usually contains some of both. The script code is what makes an Active Server Page different from a standard HTML page. |
|
|
|
|
|
|
|
|
Consider the URL, or Universal Resource Locator, that identifies documents on the Web. Here are two URLs, one for a standard Web page and the other for an Active Server Page: |
|
|
|
|
|
|
|
|
http://www.mysite.com/mypage.htm
http://www.mysite.com/mypage.asp |
|
|
|
|
|